/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jse;

import java.io.File;

/**
 *
 * @author Swang
 */
public class FileRenameTest {

    public static void main(String[] args) {
        String dir = "D:\\Cloud\\Game";
        File fileDir = new File(dir);
        renameDir(fileDir);

    }
    
    public static void renameDir(File fileDir) {
        for(File f : fileDir.listFiles()) {
            String newName = f.getParentFile() + File.separator + f.getName().toLowerCase();
            System.out.println(newName);
            
            f.renameTo(new File(newName));
            //f.setLastModified(f.lastModified() + 1);
            if(f.isDirectory()) {
                renameDir(f);
            }
        }
    }
}
